package com.one.group.admin.mapper;

import com.mybatisflex.core.BaseMapper;
import com.one.group.model.entity.QuestionOption;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 问题选项Mapper
 * @author kld
 */
@Mapper
public interface QuestionOptionMapper extends BaseMapper<QuestionOption> {

    boolean addOption(QuestionOption option);
    boolean deleteOption(Map map);

    boolean deleteOptionsByQuestionId(Map map);

    List<QuestionOption> getOptionsByQuestionId(Map map);

    boolean updateOption(QuestionOption option);
    
    /**
     * 根据问题ID对选项进行排序
     * @param questionId 问题ID
     * @param tenantId 租户ID
     * @return 是否更新成功
     */
    boolean batchUpdateSort( Long questionId,  Long tenantId);
}